/***************************************************************************
 *   Copyright (C) 2007 by shinda   *
 *   shinda@babaflex   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef SEARCH_H
#define SEARCH_H

#include "shabads.h"
#include <QtCore>
#include <QWidget>
#include <QList>
//#include <QList>
//#include <QSqlDatabase>
class QString;
class QListWidget;
class QComboBox;
class QSqlDatabase;
class QStringList;
class QGroupBox;
class QLineEdit;
class QTextEdit;
class QPushButton;
class QRadioButton;
class QComboBox;
class QGridLayout;
class QFont;
class QListWidgetItem;


class SearchWidget : public QWidget
{
	Q_OBJECT

public:
	SearchWidget(QWidget * parent=0);
	~SearchWidget();
	QGroupBox *searchBox;

signals:
	void shabadSelect(int);

private:
	void createSearchBox();
	void setConnections();
	void fillWriters(QComboBox &);
	void fillRaags(QComboBox &);


	QString getSQLStatement();
	QString String2Ascii(const QString&);

	
	QLineEdit *searchLine;
	QComboBox *searchLang;
	QComboBox *searchType;
	QComboBox *searchWriters;
	QComboBox *searchRaag;
	QRadioButton *searchPagesAll;
	QRadioButton *searchPagesRange;
	QRadioButton *searchPageExact;
	QLineEdit *txtSearchPageStarting, *txtSearchPageFinish, *txtSearchPageExact;
	QListWidget *searchResults;
	QPushButton *searchButton;
	QFont *fntGurmukhi;
	QList<int> idResults;

private slots:
	void performSearch();
	void togglePages();
	void sendShabad();
};

#endif
